*** This is my practice website to learn and practice HTML, using Microsoft Step By Step book, by Faithe Wempen. ***


Notes about style sheets

Three locations

Embedded in an individual tag

<hr style="color: red; background-color: red; height: 3px">

Embedded in the <head> section

<style>
hr {color: red; background-color: red; height: 3px}
</style>

Saved in a separate file

Save in a text file with a .css extension (commonly default.css) and called in the <head> section
.css file content: hr {color: red; background-color: red; height: 3px}
<head> section: <link rel="stylesheet" type="text/css" href="default.css" />


Multiple and nested tags

Multiple tags can be affected by the same style

h1 h2 h3 {color: red}

Applying style to a nested tag

ul ul {list-style-type: circle} (2nd bulleted list level would be circle)


Classes and IDs

To create a class

Add an argument in the opening tag: <li class="new">Kelly's New Home</li>
Add the class's style in the style area, preceding its name by a period: .new {color: green}

To create an ID (IDs can only be applied once per document)

Add an argument in the opening tag: <li id="new">Kelly's New Home</li>
Add the class's style in the style area, preceding its name by a hash symbol: #new {color: green}

Back to the top